/*
 * @Author       : 魏威 <1209562577@qq.com>
 * @Date         : 2022-04-01 17:52 周5
 * @Description  : 收藏
 */

import { Rate, RateProps } from "antd";

interface PinProps extends RateProps {
  checked: boolean;
  onCheckedChange?: (checked: boolean) => void;
}

export const Pin = ({ checked, onCheckedChange, ...resProps }: PinProps) => {
  return (
    <Rate
      count={1}
      value={checked ? 1 : 0}
      onChange={(num) => onCheckedChange?.(!!checked)}
      {...resProps}
    />
  );
};
